package cn.edu.cuit.aumalls.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.edu.cuit.aumalls.entity.Goods;
import cn.edu.cuit.aumalls.entity.OrderDetailInfo;
import cn.edu.cuit.aumalls.entity.Orders;
import cn.edu.cuit.aumalls.service.FindOrderService;
import en.edu.cuit.aumalls.mapper.FindOrderMapper;

@Service("findOrderService")
public class FindOrderServiceImpl implements FindOrderService {

	@Autowired
	private FindOrderMapper findOrderMapper;
	
	
	@Override
	public PageInfo<Orders> findUserOrder(int pageNum, int pageSize, int order_user) {
		
		PageHelper.startPage(pageNum, pageSize);
		
		List<Orders> list = findOrderMapper.findOrderByUser(order_user);
		
		PageInfo<Orders> pageInfols = new PageInfo<Orders>(list);
		
		return pageInfols;
	}


	@Override
	public List<OrderDetailInfo> findOrderGoods(String detailOrder) {
		
		List<OrderDetailInfo> list = findOrderMapper.findOrderGoodsByID(detailOrder);
		
		return list;
	}


	@Override
	public List<OrderDetailInfo> findOrderAllGoods() {
		
		List<OrderDetailInfo> list = findOrderMapper.findOrderAllGoods();
		return list;
	}

}
